<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="stylesheet" href="/static/assets/css/layui.css">
    <link rel="stylesheet" href="/static/assets/css/view.css"/>
    <title></title>
</head>
<body class="layui-view-body">
<div class="layui-content">
    <div class="layui-row">
        <div class="layui-card">
            <div class="layui-card-header">
                添加SSH
                <button style="float: right;" onclick="show()" class="layui-btn-sm layui-btn-blue" id="show">说明</button>
            </div>
            <form class="layui-form layui-card-body">
                <div class="layui-form-item">
                    <label class="layui-form-label">服务器备注</label>
                    <div class="layui-input-inline">
                        <input type="text" name="nickname" placeholder="输入服务器昵称" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">服务器IP</label>
                    <div class="layui-input-inline">
                        <input type="text" name="ip" required  lay-verify="required" placeholder="请输入服务器IP" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">SSH端口</label>
                    <div class="layui-input-inline">
                        <input type="number" name="port" required lay-verify="required" placeholder="请输入SSH端口" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">SSH用户</label>
                    <div class="layui-input-inline">
                        <input type="text" name="username" required lay-verify="required" placeholder="请输入SSH用户" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">SSH密码</label>
                    <div class="layui-input-inline">
                        <input id="passwd" type="password" name="password" required lay-verify="required" placeholder="请输入SSH连接密码" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">加密密码</label>
                    <div class="layui-input-inline">
                        <input id="key" type="password" name="setpass" required lay-verify="required" placeholder="请不要忘记该密码！" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">密文</label>
                    <div class="layui-input-block">
                        <textarea id="aes" readonly name="desc" placeholder="这里是根据加密密码加密后的密码信息，用于保存" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button onclick="addser()" type="button" class="layui-btn layui-btn-blue" >立即提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="/static/assets/layui.all.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/crypto-js/4.0.0/aes.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/blueimp-md5/2.18.0/js/md5.min.js"></script>
<script src="/static/js/net.js"></script>
<script src="/static/js/aes.js?v=1.0"></script>
<script src="/static/js/add.js?v=1.95"></script>
<script>
    var index = layer.load(0, {shade: [0.1,'#fff']});
    document.onreadystatechange = completeLoading;
    //加载状态为complete时移除loading效果
    function completeLoading() {
        console.log("Loading Success")
        if (document.readyState == "complete") {
            layer.close(index);
        }
    }
    $(document).keyup(function(event){
        if(event.keyCode ==13){
            addser();
        }
    });
</script>
</body>
</html>